package uy.com.csi.gestpro.model.proyecto;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;


/**
 * The persistent class for the gp_tra_ftra database table.
 * 
 */
@Entity
@Table(name="gp_tra_ftra", schema="proyecto")
@NamedQuery(name="GpTraFtra.findAll", query="SELECT g FROM GpTraFtra g")
public class GpTraFtra implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;

	private String dscrpcion;

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="id_prycto")
	private GpPrycto prycto;

	@OneToMany(mappedBy="gpTraFtra")
	private List<GpActvdadFtra> actvdadFtras;
	
	@OneToMany(mappedBy="gpTrFtra")
	private List<GpTreaPrsnal> gpTreaPrsnals;
	
	public GpTraFtra() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDscrpcion() {
		return this.dscrpcion;
	}

	public void setDscrpcion(String dscrpcion) {
		this.dscrpcion = dscrpcion;
	}

	public GpPrycto getPrycto() {
		return prycto;
	}

	public void setPrycto(GpPrycto prycto) {
		this.prycto = prycto;
	}

	public List<GpActvdadFtra> getActvdadFtras() {
		return actvdadFtras;
	}

	public void setActvdadFtras(List<GpActvdadFtra> actvdadFtras) {
		this.actvdadFtras = actvdadFtras;
	}

	public List<GpTreaPrsnal> getGpTreaPrsnals() {
		return gpTreaPrsnals;
	}

	public void setGpTreaPrsnals(List<GpTreaPrsnal> gpTreaPrsnals) {
		this.gpTreaPrsnals = gpTreaPrsnals;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GpTraFtra other = (GpTraFtra) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}